package ObserverPattern;

/**
 * @Author: zhaojie
 * @Date: Created in 17:31 2018/6/25
 * @Description:
 */
public class HexaObserver extends Observer{
    public HexaObserver(Subject subject) {
        this.subject=subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println( "Hex String: "
                + Integer.toHexString( subject.getState() ).toUpperCase() );
    }
}
